/*
 * @Author: LiDongxue 
 * @Date: 2018-05-19 11:00:31 
 * @Last Modified by: LiDongxue
 * @Last Modified time: 2018-05-19 17:03:17
 */

// const gettype = Object.prototype.toString

// let a = gettype.call('aaaa')  //输出      [object String]
// console.log(a);
// let b = gettype.call(0)   // 输出      [object Number]
// console.log(b);
// let c = gettype.call(true)   // 输出      [object Boolean]
// console.log(c);
// let d = gettype.call(undefined) //  输出      [object Undefined]
// console.log(d);
// let e = gettype.call(null)  // 输出   [object Null]
// console.log(e);
// let f = gettype.call({})   // 输出   [object Object]
// console.log(f);
// let g = gettype.call([])   // 输出   [object Array]
// console.log(g);
// let h = gettype.call(function () { }) //    输出   [object Function]
// console.log(h);

const gettype = Object.prototype.toString

const utility = {
    isString :o=>gettype.call(o)=== "[object String]",
    isNumber :o=>gettype.call(o)=== "[object Number]"&&!isNaN(o),
    isBoolean :o=> gettype.call(o)=== "[object Boolean]",
    isObj: o=>gettype.call(o) === "[object Object]",
    isArray: o=>gettype.call(o) === "[object Array]",
    isNULL: o=>gettype.call(o) === "[object Null]",
    isUndefined: o=>gettype.call(o) === "[object Undefined]",
    isFunction:o=>gettype.call(o)=== "[object Function]"
}
module.exports = utility;